package com.example.musicserver.mapper;

import com.example.musicserver.model.User;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;

public interface UserMapper {
    /**
     * 注册时，查看用户名是否存在
     * @param user
     * @return
     */
    @Select("select * from user where username=#{username}")
    User selectUsername(User user);

    /**
     * 往数据库内添加用户信息
     * @param user
     * @return
     */
    @Insert("insert into user(username,password) values(#{username},#{password})")
    int add(User user);
}
